import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class zhaomax {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        System.out.println(list);
        int max= Collections.max(list);
        System.out.println(max);
        System.out.println("======");
        int max1=list.get(0);
        for(Integer X:list){
            if(X>=max1){
                max1=X;
            }
        }
        System.out.println("max1="+max1);

    }
}
